package cn.edu.scau.cmi.xuxingao.singleton;

import java.util.ArrayList;
import java.util.List;

public class Marshal {
	final static int num = 10; 
	private String name;
	private static List<Marshal> marshalList =  new ArrayList<Marshal>(); 
	private Marshal(String name) {
		this.name = name;
	}
	
	public static List<Marshal> createInstance(String name) {
		if(marshalList.size()<10) {
			Marshal marshal = new Marshal(name);
			marshalList.add(marshal);
		}
		return marshalList;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	
	public static boolean check() {
		if(marshalList.size() < num)
			return true;
		else
			return false;
	}
}
